//DTO用来验证对象  使用class-validator和class-transformer
import {IsNotEmpty,IsEmail} from 'class-validator'
import {Transform} from 'class-transformer'

export class UserDTO{
    @IsNotEmpty({message:'name不能为空'})
    @Transform((user)=>user.value.trim())
    name:string

    @IsNotEmpty({message:'email不能为空且不可重复'})
    @IsEmail({},{message:'email格式不正确'})
    email:string

    password:string
}